package org.magnerfuller.imtoolkit.server.service;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;

public abstract class ServiceBackendAdapter extends ServiceBackend {

  private PipedInputStream inputStream;
  
  private PipedOutputStream outputStream;
  
  protected PipedInputStream myInputStream;
  
  protected PipedOutputStream myOutputStream;
  
  public ServiceBackendAdapter() throws IOException {
    super();
    inputStream = new PipedInputStream();
    outputStream = new PipedOutputStream();
    
    myInputStream = new PipedInputStream(outputStream);
    myOutputStream = new PipedOutputStream(inputStream);
  }

  public InputStream getInputStream() {
    return inputStream;
  }

  public OutputStream getOutputStream() {
    return outputStream;
  }

  public abstract void run();


}
